/* Copyright (c) 2025 Beijing Semidrive Technology Corporation
 * SPDX-License-Identifier: Apache-2.0
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/** *****************************************************************************************************
 * \file     Lp_comm.h                                                                                  *
 * \brief    Communication with the lp core                                                             *
 *                                                                                                      *
 * <table>                                                                                              *
 * <tr><th>Date           <th>Version                                                                   *
 * <tr><td>2025/03/11     <td>1.0U.0U                                                                   *
 * </table>                                                                                             *
 *******************************************************************************************************/

#ifndef LP_COMM_H
#define LP_COMM_H

#ifdef __cplusplus
extern "C" {
#endif

/********************************************************************************************************
 *                                      Include header files                                            *
 *******************************************************************************************************/

/********************************************************************************************************
 *                                      Macro definition                                                *
 *******************************************************************************************************/

/**
 * @brief LP CMD Type
 */
typedef struct {
    uint32_t cmd;
    uint32_t reserved[15];
} lp_comm_msg_t;

/**
 * @brief CMD Type
 */
typedef enum {
    LP_CMD_INVALID                  = 0x00U,
    LP_CMD_ENTER_SLEEP              = 0x101U,
    LP_CMD_ENTER_HIB                = 0x102U,
    LP_CMD_ENTER_RTC                = 0x103U,
    LP_CMD_ENTER_LPRUN              = 0x104U,
    LP_CMD_STATE_GET                = 0x105U,
    LP_CMD_STATE_ACK                = 0x106U,
    LP_CMD_CUSTOM_GET               = 0x107U,
    LP_CMD_CUSTOM_ACK               = 0x108U,
} lp_cmd_type;

/**
 * @brief LP State Type
 */
typedef struct {
    uint32_t wakeup_src;
    uint32_t wakeup_src_add;
    uint32_t power_down_reason;
    uint32_t wakeup_first;
} lp_state_t;

/********************************************************************************************************
 *                                      Global variables                                                *
 *******************************************************************************************************/

/********************************************************************************************************
 *                                  Global Function Declarations                                        *
 *******************************************************************************************************/

#ifdef __cplusplus
}
#endif

#endif  /* ifndef LP_COMM_H */
/* End of file */
